package reduce.fz.com.reduce.fragment;


import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;

import reduce.fz.com.reduce.R;

public class TeamDetailExplainFragment extends Fragment {
    private WebView wvDetailExplain;
    private String webUrl;
    private Long teamid;

    public static TeamDetailExplainFragment create(Long teamid) {
        Bundle bundle = new Bundle();
        bundle.putLong("teamid", teamid);
        TeamDetailExplainFragment explain=new TeamDetailExplainFragment();
        explain.setArguments(bundle);
        return explain;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
       teamid= this.getArguments().getLong("teamid");
    }

    public TeamDetailExplainFragment() {
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_team_detail_explain, container, false);
    }

    public void initWidget(View view) {
        wvDetailExplain = (WebView) view.findViewById(R.id.wv_detail_explain);
        wvDetailExplain.getSettings().setJavaScriptEnabled(true);
        wvDetailExplain.loadUrl(webUrl);
    }

    public String getRequestUrl() {
        return webUrl+"?teamid="+teamid;
    }


}
